//8:预习：定义一个整数数组，求数组中所有数的和 以及乘积
public class Task1 {
    public static void main(String[] args) {
        int[] a = {1, 2, 3, 4, 5};
        int sum = 0, product = 1, i = 0;
        for (; i < a.length; i++) {
            sum += a[i];
            product *= a[i];
        }
        System.out.println("sum is " + sum + ";product is " + product);
    }
}
